﻿@model PagedList.IPagedList<MSDAL.Sale>
@using PagedList.Mvc;
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            Nazwa Sali:
        </th>
        <th>
            Komentarz:
        </th>
        <th>
            Czy Aktywna:
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.NazwaSali)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Komentarz)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CzyAktywna)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.IDSali }) |
                @Html.ActionLink("Details", "Details", new { id = item.IDSali }) |
                @Html.ActionLink("Delete", "Delete", new { id = item.IDSali })
            </td>
        </tr>
    }

</table>
<br />
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount

@Html.PagedListPager(Model, page => Url.Action("Index",
    new { page, sortOrder = ViewBag.CurrentSort, currentFilter = ViewBag.CurrentFilter }))